getList()
function getList() {
    $.get('./api/shop/list.php', resp => {
        console.log(resp)
        if (resp.code === 1) {
            const { list } = resp.body
            // 根据list数组来渲染表格
            $('#tbody').html(list.reduce((html, shop, index) => {
            // tbody.innerHTML = list.reduce((html, shop, index) => {
                html += `
                    <tr data-id="${shop.id}">
                        <td>${index + 1}</td>
                        <td><span>${shop.name}</span><input class="nameInput" type="text"></td>
                        <td><span>${shop.price}</span><input class="priceInput" type="text"></td>
                        <td><span>${shop.num}</span><input class="numInput" type="text"></td>
                        <td>
                            <button class="btn btn-xs btn-info btn-edit">编辑</button>
                            <button class="btn btn-xs btn-danger btn-del">删除</button>
                            <button class="btn btn-xs btn-success btn-ok">确定</button>
                            <button class="btn btn-xs btn-warning btn-cancel">取消</button>
                        </td>
                    </tr>
                `
                return html
            }, ''))
        }

    },'json')
}
